package com.sys.basics.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import com.sys.basics.entity.SysRoleResourceLk;
import com.sys.basics.dao.SysRoleResourceLkDao;
import com.sys.basics.service.SysRoleResourceLkService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author: ares
 * @date: 2021-10-20
 * @description: 角色资源关联表 服务实现类
 */
@Slf4j
@Service
public class SysRoleResourceLkServiceImpl extends ServiceImpl<SysRoleResourceLkDao, SysRoleResourceLk> implements SysRoleResourceLkService {
    @Autowired
	SysRoleResourceLkDao sysRoleResourceLkDao;

    @Override
    public int batchCreate(Long roleId, List<Long> resourceIds) {
        return sysRoleResourceLkDao.batchCreate(roleId, resourceIds);
    }

    @Override
    public int batchRemove(Long roleId, List<Long> resourceIds) {
        return sysRoleResourceLkDao.batchRemove(roleId, resourceIds);
    }

    @Override
    public List<SysRoleResourceLk> getLinkedResourceByRoleId(Long roleId) {
        return sysRoleResourceLkDao.getLinkedResourceByRoleId(roleId);
    }
}
